package com.ag.hmk.action;

import java.util.List;

import com.ag.bean.TbGoods;
import com.ag.common.BaseAction;
import com.ag.hmk.service.impl.GoodsServImpl;
/**
 * 
 * @author hmk
 * 查询所有物资
 */
public class GetGoodsAction extends BaseAction {

	private static final long serialVersionUID = 81231321311L;
	
	private GoodsServImpl goodsServImpl;
	private List<TbGoods> goodsList;

	/*
	 * 查询所有物资
	 */
	public String getGoods()throws Exception{
		List<TbGoods> gList = null;
		try {
			gList = goodsServImpl.findAll();
		} catch (Exception e) {
			e.printStackTrace();
			gList = null;
		}
		this.setGoodsList(gList);
		System.out.println("=========查找所以物资======");
		return "getGoodsOK";
	}

	public List<TbGoods> getGoodsList() {
		return goodsList;
	}

	public void setGoodsList(List<TbGoods> goodsList) {
		this.goodsList = goodsList;
	}

	public void setGoodsServImpl(GoodsServImpl goodsServImpl) {
		this.goodsServImpl = goodsServImpl;
	}
	
}
